home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / cenvid9.zip / CENVILIB.DOC < prev    next >
Text File  |  1994-03-09  |  29KB  |  567 lines

  1.                     CEnvi Shareware Manual, Chapter 4:
  2.                              Function Library
  3.  
  4.                      CEnvi unregistered version 1.009
  5.                                9 March 1994
  6.  
  7.                        CEnvi Shareware User's Manual
  8.  
  9.           Copyright 1993, Nombas, All Rights Reserved.
  10.           Published by Nombas, P.O. Box 875, Medford, MA 02155 USA
  11.           (617)391-6595
  12.  
  13.           Thank you for trying this shareware version of CEnvi from Nombas,
  14.           a member of the Association of Shareware Professionals (ASP).
  15.  
  16. 4.  CEnvi Internal Function Library
  17.  
  18.           CEnvi includes a large library of internal functions that are
  19.           available for use in your CEnvi code.  (External function
  20.           libraries, and a developer toolkit for creating external
  21.           libraries, will be available in an upcoming incremental release.)
  22.  
  23. 4.1.  Standard Library
  24.  
  25.           The C language has long had a standard set of libraries that
  26.           contain routines included with nearly all C implementations.
  27.           Most of this standard library, as defined by ANSI and ISO, is
  28.           included internally to CEnvi, and so all of these routines are
  29.           available to any Cmm program executed by CEnvi.
  30.  
  31.           Minimal modifications have been added to the standard library to
  32.           support the differences between the Cmm and the C languages.  In
  33.           most cases, these modifications involve the redefinition of
  34.           variable pointers to become variables-passed-by-reference.
  35.           Usually, though, the Cmm call to one of these functions looks
  36.           identical to the C call.  The experienced C programmer should
  37.           feel right at home.
  38.  
  39.           A few functions have been dropped in this version, mostly those
  40.           dealing with locales.  A few functions have also been added
  41.           beyond those in the ANSI and ISO standards when those functions
  42.           seem to be common across most existing implementations of C
  43.           libraries.
  44.  
  45.             CLOCKS_PER_SEC: defined for system clock rate
  46.             FALSE: #define'd 0
  47.             TRUE: #define'd 1
  48.             NULL: #define'd 0
  49.             EXIT_FAILURE: failure program exit value
  50.             EXIT_SUCCESS: good program exit value
  51.             RAND_MAX: maximum number returned by rand()
  52.  
  53.             abort: Terminate program; probably due to error.
  54.               void abort()
  55.             abs: Return the absolute value of an integer.
  56.               int abs(int x)
  57.             acos: Calculate the arc cosine.
  58.               float acos(float x)
  59.             asctime: Convert data and time to an ASCII string.
  60.               string asctime(struct tm)
  61.             asin: Calculate the arc sine.
  62.               float asin(float x)
  63.             assert: Test a condition and abort if it is FALSE.
  64.               void assert(bool test)
  65.             atan: Calculate the arc tangent.
  66.               float atan(float x)
  67.             atan2: Calculate the arc tangent of a fraction.
  68.               float atan2(float y,float x)
  69.             atexit: Register function to be called at program exit.
  70.               void atexit(string functionName)
  71.             atof: Convert ascii string to a floating-point number
  72.               float atof(string str)
  73.             atoi: Convert ascii string to an integer.
  74.               int atoi(string str)
  75.             atol: Convert ascii string to an integer.
  76.               int atol(string str)
  77.             bsearch: Binary search for member of a sorted array.
  78.               int bsearch(var key,var[] SortedArray,[int
  79.               ElementCount,]string CompareFunction)
  80.             ceil: Ceiling; round up.
  81.               float ceil(float x)
  82.             clearerr: Clear end-of-file and error status for a file.
  83.               void clearerr(FILE stream)
  84.             clock: Get processor time.
  85.               int clock()
  86.             cos: Calculate the cosine.
  87.               float cos(float x)
  88.             cosh: Calculate the hyperbolic cosine.
  89.               float cosh(float x)
  90.             ctime: Convert date-time to an ascii string.
  91.               string ctime(int time)
  92.             difftime: Compute difference between two times.
  93.               float difftime(int time1,int time0)
  94.             div: Integer division, returning quotient and remainder.
  95.               struct div(int numerator,int denominator)
  96.             errno: Value of error condition
  97.               int errno
  98.             exit: Normal program termination.
  99.               void exit(int status)
  100.             exp: Compute the exponential function.
  101.               float exp(float x)
  102.             fabs: Absolute value.
  103.               float fabs(float x)
  104.             fclose: Close an open file.
  105.               int fclose(FILE stream)
  106.             feof: Test if at end of file stream.
  107.               bool feof(FILE stream)
  108.             ferror: Test for error on a file stream.
  109.               int ferror(FILE stream)
  110.             fflush: Flush stream for open file(s).
  111.               int fflush(FILE stream)
  112.             fgetc: Get a character from file stream.
  113.               int fgetc(FILE stream)
  114.             fgetpos: Get current position of a file stream.
  115.               int fgetpos(FILE stream,Var pos)
  116.             fgets: Get a string from an input stream.
  117.               string fgets([string buf[,int buflen],]FILE stream)
  118.             floor: Round down.
  119.               float floor(float x)
  120.             fmod: Modulus; calculate remainder.
  121.               float fmod(float x,float y)
  122.             fopen: Open a file.
  123.               FILE fopen(string filename,string mode)
  124.             fprintf: Formatted output to a file stream.
  125.               int fprintf(FILE stream,string format,...)
  126.             fputc: Write a character to a file stream.
  127.               int fputc(int c,FILE stream)
  128.             fputs: Write a string to a file stream.
  129.               int fputs(string s,FILE stream)
  130.             fread: Read data from a file.
  131.               int fread(byte[] DestBuffer,bufferLen,stream)
  132.               int fread(Var DestVar,int DataTypeInFile,stream)
  133.             freopen: Assign a new file specification to a file handle.
  134.               FILE freopen(string filename,string mode,FILE OldFP)
  135.             frexp: Break into a mantissa and an exponential power of 2.
  136.               float frexp(float x,int exponent)
  137.             fscanf: Formatted input from a file stream.
  138.               int fscanf(FILE stream,string format,...)
  139.             fseek: Set the file position for an opened file stream.
  140.               int fseek(stream,offset[,mode])
  141.             fsetpos: Set position of a file stream.
  142.               int fsetpos(stream,Var pos)
  143.             ftell: Get the current value of the file position.
  144.               int ftell(FILE stream)
  145.             fwrite: Write data to a file.
  146.               int fwrite(byte[] SourceBuffer,bufferLen,stream)
  147.               int fwrite(Var SourceVar,int DataTypeInFile,stream)
  148.             getc: Get a character from file stream.
  149.               int getc(FILE stream)
  150.             getch: Get a character from the keyboard; without echo.
  151.               int getch()
  152.             getchar: Get a character from standard input (keyboard).
  153.               int getchar()
  154.             getche: Get a character from the keyboard; with echo.
  155.               int getch()
  156.             getenv: Get an environment string.
  157.               string getenv(string VariableName)
  158.             gets: Read a string from standard input (keyboard).
  159.               string gets([string buf])
  160.             gmtime: Convert data and time to Greeenwich mean time (GMT).
  161.               struct gmtime(int t)
  162.             isalnum: Test for alphanumeric character.
  163.               bool isalnum(int c)
  164.             isalpha: Test for alphabetic character.
  165.               bool isalpha(int c)
  166.             isascii: Test for ASCII coded character.
  167.               bool isascii(int c)
  168.             iscntrl: Test for any control character.
  169.               bool iscntrl(int c)
  170.             isdigit: Test for any decimal-digit character.
  171.               bool isdigit(int c)
  172.             isgraph: Test for an